/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cardarus.operatingsystem.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;

/**
 * This the class of Holiday Periods
 * @author Javier Snaider
 */
@Entity
public class HolidayPeriod implements Serializable {
    
    /**
     * Holiday period ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    
    /**
     * Start Date of Holiday Period 
     */
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date startDate;
    
    /**
     * End Date of Holiday Period 
     */
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date endDate;
    
    
    /**
     * Short description of Holiday Period 
     */
    private String description;
    
    /**
     * @return Id of Holiday Period 
     */
    public int getId() {
        return id;
    }
    
    /**
     * @param id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return Hash Code of Holiday Period 
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) getId();
        return hash;
    }

    /**
     * Check if two Holiday Period are the same
     * @param object
     * @return the boolean value of if the two are the same
     */
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HolidayPeriod)) {
            return false;
        }
        HolidayPeriod other = (HolidayPeriod) object;
        if (this.getId() != other.getId()) {
            return false;
        }
        return true;
    }

    /**
     * @return a String version of the Holiday Period ID
     */
    @Override
    public String toString() {
        return "com.cardarus.operatingsystem.domain.HolidayPeriod[id=" + getId() + "]";
    }

    /**
     * @return the startDate
     */
    public Date getStartDate() {
        return startDate;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * @return the endDate
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @param endDate the endDate to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

}
